﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Collections.Specialized;
using System.Linq;

namespace MainProject.Vanchuyen
{
    public partial class step1 : TSWizards.BaseInteriorStep
    {
        public step1()
        {
            InitializeComponent();
            loaddata();
        }
        protected void loaddata()
        {
            QLXT_DBDataContext db = new QLXT_DBDataContext();
            cmb_Xe.DataSource = from q in db.XEs 
                                join k in db.TINHTRANGs 
                                on q.TINHTRANG equals k.IDTINHTRANG 
                                where k.TINHTRANG1 == "Sẵn sàng" select q;
            cmb_Taixechinh.DataSource = from q in db.TAIXEs
                                        join k in db.VANCHUYENs
                                        on q.IDTAIXE equals k.TAIXECHINH
                                        join m in db.VANCHUYENs
                                        on q.IDTAIXE equals m.TAIXEPHU
                                        where k.NGAYVETRAM < DateTime.Now || m.NGAYVETRAM < DateTime.Now || k.NGAYVETRAM.HasValue == false || m.NGAYVETRAM.HasValue == false
                                        select q;
            cmb_Taixephu.DataSource = from q in db.TAIXEs
                                        join k in db.VANCHUYENs
                                        on q.IDTAIXE equals k.TAIXECHINH
                                        join m in db.VANCHUYENs
                                        on q.IDTAIXE equals m.TAIXEPHU
                                        where k.NGAYVETRAM > DateTime.Now || m.NGAYVETRAM < DateTime.Now || k.NGAYVETRAM.HasValue == false || m.NGAYVETRAM.HasValue == false
                                        select q;
        }

        public StringCollection getinfo()
        {
            return null;
        }
    }
}
